import { contextBridge, ipcRenderer } from "electron";

contextBridge.exposeInMainWorld("electronAPI", {
  createDatabase: (params: { name: string }) =>
    ipcRenderer.invoke("database:create", params),
  getDatabaseList: () => ipcRenderer.invoke("database:list"),
  getTableList: (params: { name: string }) =>
    ipcRenderer.invoke("table:getList", params),
  createTable: (params: Array<{ name: string }>) =>
    ipcRenderer.invoke("table:create", params),
  deleteTable: (params: { databaseName: string; tableName: string }) => {
    return ipcRenderer.invoke("table:delete", params);
  },
});
